package com.econ.powercloud.ems.controller;

import com.econ.powercloud.common.base.facade.pojo.MsgResult;
import com.econ.powercloud.ems.pojo.EmsEnergyEquipmentVO;
import com.econ.powercloud.ems.service.biz.EnergyEquipmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author : zjf
 * @Description : controller
 * @Date : 2021/8/10 14:41
 * @Modified by : zjf
 */
@Api(tags = "储能装置")
@RestController
@RequestMapping(value = "/api/v2/energyEquipment")
public class EnergyEquipmentController extends ApiBaseController {

    @Autowired
    private EnergyEquipmentService energyEquipmentService;

    @ApiOperation(value = "获取某一个储能装置详情")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "stationId", value = "储能站id", dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "equipmentId", value = "储能装置id", dataType = "String")
    })
    @GetMapping(value = "getEnergyEquipment")
    public MsgResult<EmsEnergyEquipmentVO> getEnergyEquipment(@RequestParam(value = "stationId") String stationId,
                                                              @RequestParam(value = "equipmentId") String equipmentId){
        return successHandler(energyEquipmentService.selectByStationIdAndEquipmentId(stationId,equipmentId));
    }

}
